package pl.edu.kassiopeia.repository.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import pl.edu.kassiopeia.repository.dao.PluginDao;
import pl.edu.kassiopeia.repository.exceptions.PluginNotFoundException;
import pl.edu.kassiopeia.repository.model.Plugin;

@Service
public class PluginServiceImpl implements PluginService {

	@Autowired
	PluginDao pluginDao;
	
	public void setPluginDao(PluginDao pluginDao){
		this.pluginDao = pluginDao;
	}
	
	@Override
	public void save(Plugin plugin) {
		this.pluginDao.save(plugin);
	}

	@Override
	public void update(Plugin plugin) {
		this.pluginDao.update(plugin);
	}

	@Override
	public void delete(Plugin plugin) {
		this.pluginDao.delete(plugin);
	}

	@Override
	public List<Plugin> findAll() {
		return this.pluginDao.findAll();
	}

	@Override
	public Plugin findByCoordinates(String groupId,
			String pluginId, String version) throws PluginNotFoundException {
		return pluginDao.findByCoordinates(groupId, pluginId, version);
	}

}
